<?php
/* @var $this PageController */
/* @var $model Page */

$this->widget('bootstrap.widgets.TbBreadcrumbs',array(
	'links'=>array(
		'Pages'
	),
));

$this->menu=array(
	array('label'=>'Operations'),
	array('label'=>'Create Page', 'icon'=>'star', 'url'=>array('create')),
	array('label'=>'View Page', 'icon'=>'eye-open', 'url'=>'#', 'disabled'=>true),
	array('label'=>'Update Page', 'icon'=>'pencil', 'url'=>'#', 'disabled'=>true),
	array('label'=>'Delete Page', 'icon'=>'trash', 'url'=>'#', 'disabled'=>true),
	array('label'=>'Manage Pages', 'icon'=>'cog', 'url'=>'#', 'active'=>true),
	array('label'=>'List Pages', 'icon'=>'th-list', 'url'=>array('index')),
	array('label'=>'Page Options'),
	array('label'=>'Add Content to Page', 'icon'=>'tasks', 'url'=>'#', 'disabled'=>true),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('page-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="row">
	<div class="span9">
		<div style="padding: 10px;">
<h2>Manage Pages</h2>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button btn')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id'=>'page-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'name',
		'slug',
		'hasTabs:boolean',
		/*
		'create_time',
		'create_user_id',
		'update_time',
		'update_user_id',
		*/
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
		),
	),
)); ?>
		</div>
	</div>
	<div class="span3">
	<?php
		$this->beginWidget('zii.widgets.CPortlet', array(
			'title'=>'Administration',
		));
		$this->widget('bootstrap.widgets.TbMenu',array(
			'type'=>'list',
			'items'=>$this->menu,
		));
		$this->endWidget();
	?>
	</div>
</div>